(1) Field of the Invention
The present invention relates to a technique for detecting a motion vector in a motion-compensated predictive coding, which is one of compression methods for a moving picture.
(2) Description of the Related Art
In recent years, a technique for compressing an image at high compression ratio has been developed. This technique is used for digital cameras and digital video cameras.
MPEG (Moving Picture Experts Group) is generally known as a compression method for a moving picture. In MPEG, motion-compensated prediction is used for efficiently compressing image data, by which only displacements and difference data of an object image are encoded. In this motion-compensated prediction, a motion vector, which indicates the displacements of the object image, is calculated with use of several methods, such as a block-matching method.
PATENT DOCUMENT 1 discloses a reference image data buffer including a first bank and a second bank. Forty-three block images as a unit of processing, which are disposed in the horizontal direction in a reference frame image, are written into the first bank. Each block image consists of 16 pixels×8 lines. The image data stored in the first bank is read out for calculating a motion vector. At the same time, the succeeding unit of processing in the reference frame image, which is to be processed next, is written into the second bank. Then, the first bank takes over the role of the second bank, and vice versa. The image data stored in the second bank is read out for calculating a motion vector, and at the same time, image data in the succeeding unit of processing in the reference frame image is written into the first bank. These operations are performed repeatedly.
The following is a description of the method disclosed in the PATENT DOCUMENT 1 based on an assumption that the capacity of the reference image data buffer is as small as possible. More specifically, one frame image is assumed to consist of 128 pixels ×128 lines of image data. One frame image is equally divided into sixty-four (8×8) macroblocks. In such a frame, macroblocks are numbered from left to right and top to bottom. One macroblock includes 16 pixels×16 lines of image data. In the following description, the numbers for macroblocks are called “block numbers”. Also, a macroblock having a block number “n” included in the reference frame image is called a reference block “n”, and a macroblock having a block number “n” included in an object frame image is called an object block “n”, and so on. Further, macroblocks constituting a reference frame image are called reference blocks, and macroblocks constituting an object frame image are called object blocks.
As FIG. 25A shows, a reference image data buffer 200 includes a first bank 50 and a second bank 51. Each bank consists of 9 areas, and each area has a capacity for storing one macroblock.
In the detection of a motion vector of one object block, a “reference area” means an area in a reference frame image including 3 rows×3 columns of reference blocks in such a manner that a reference block having the same number as the object block is included in the center of the reference blocks. A reference frame image is stored in a reference frame memory.
Firstly, as FIG. 25A shows, areas 50e, 50f, 50h, and 50i in the first bank 50 store a reference block “1”, a reference block “2”, a reference block “9”, and a reference block “10” respectively. These reference blocks are included in a reference area of an object block “1”.
Next, as FIG. 25B shows, the motion vector is detected in the reference blocks stored in the first bank. At the same time, reference blocks “1”, “2”, “3”, “9”, “10”, and “11” included in a reference area of an object block “2” are transferred from the reference frame memory to areas 51e to 51i in the second bank 51 respectively.
Next, the first bank 50 takes over the role of the second bank 51, and vice versa. Then, as FIG. 25C shows, reference blocks “2”, “3”, “4”, “10”, “11”, and “12” included in a reference area of an object block “3” are transferred from the reference frame memory to areas 50d to 50i in the first bank 50 respectively. In parallel with this, the motion vector is detected in the reference blocks stored in the second bank 51.
The operations for detecting motion vectors are performed repeatedly as described above.
Here, in FIG. 25B, the reference block “2” stored in the area 50h of the first bank 50 and the reference block “2” stored in the area 51e of the second bank 51 are redundant. Also, the reference block “10” stored in the area 50i of the first bank 50 and the reference block “10” stored in the area 51f of the second bank 51 are redundant. Also in FIG. 25C, the reference block “2”, the reference block “3”, the reference block “10” and the reference block “11” are stored in both the first bank 50 and the second bank 51.
Reference blocks stored in the reference image data buffer 200 are transferred from the reference frame memory as needed. Therefore, in the case described above, the same data is transferred several times from the reference frame memory to the reference image data buffer, which is inefficient.